<!DOCTYPE HTML>
<html lang="zh-CN">


<head>
    <meta charset="utf-8">
    <meta name="keywords" content="部署hexo到github, 个人博客，柠檬之翼，笔记，文章">
    <meta name="description" content="部署hexo到github上1. 申请github账号
进入https://github.com/申请，我这里申请的用户名是lmwings
建立个人仓库，仓库名为lmwings.github.io，这个是规则是固定的，一个账号只有一个git">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <title>部署hexo到github | 嘟嘟嘴的窝</title>
    <link rel="icon" type="image/png" href="/favicon.png">

    <link rel="stylesheet" type="text/css" href="/libs/awesome/css/all.css">
    <link rel="stylesheet" type="text/css" href="/libs/materialize/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/aos/aos.css">
    <link rel="stylesheet" type="text/css" href="/libs/animate/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/lightGallery/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/css/my.css">
    
    <script src="/libs/jquery/jquery.min.js"></script>
    
<meta name="generator" content="Hexo 4.2.0"><link rel="alternate" href="/atom.xml" title="嘟嘟嘴的窝" type="application/atom+xml">
<link rel="stylesheet" href="/css/prism-tomorrow.css" type="text/css"></head>


<body>
    <header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="nav-wrapper container">
            <div class="brand-logo">
                <a href="/" class="waves-effect waves-light">
                    
                    <img src="/medias/logo.png" class="logo-img" alt="LOGO">
                    
                    <span class="logo-span">嘟嘟嘴的窝</span>
                </a>
            </div>
            

<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fas fa-bars"></i></a>
<ul class="right nav-menu">
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/" class="waves-effect waves-light">
      
      <i class="fas fa-home" style="zoom: 0.6;"></i>
      
      <span>首页</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/tags" class="waves-effect waves-light">
      
      <i class="fas fa-tags" style="zoom: 0.6;"></i>
      
      <span>标签</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/categories" class="waves-effect waves-light">
      
      <i class="fas fa-bookmark" style="zoom: 0.6;"></i>
      
      <span>分类</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/archives" class="waves-effect waves-light">
      
      <i class="fas fa-archive" style="zoom: 0.6;"></i>
      
      <span>归档</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/about" class="waves-effect waves-light">
      
      <i class="fas fa-user-circle" style="zoom: 0.6;"></i>
      
      <span>关于</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/contact" class="waves-effect waves-light">
      
      <i class="fas fa-comments" style="zoom: 0.6;"></i>
      
      <span>留言板</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/friends" class="waves-effect waves-light">
      
      <i class="fas fa-address-book" style="zoom: 0.6;"></i>
      
      <span>友情链接</span>
    </a>
    
  </li>
  
  <li>
    <a href="#searchModal" class="modal-trigger waves-effect waves-light">
      <i id="searchIcon" class="fas fa-search" title="搜索" style="zoom: 0.85;"></i>
    </a>
  </li>
</ul>

<div id="mobile-nav" class="side-nav sidenav">

    <div class="mobile-head bg-color">
        
        <img src="/medias/logo.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">嘟嘟嘴的窝</div>
        <div class="logo-desc">
            
            分享个人学习笔记，记录生活
            
        </div>
    </div>

    

    <ul class="menu-list mobile-menu-list">
        
        <li class="m-nav-item">
	  
		<a href="/" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-home"></i>
			
			首页
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/tags" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-tags"></i>
			
			标签
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/categories" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-bookmark"></i>
			
			分类
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/archives" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-archive"></i>
			
			归档
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/about" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-user-circle"></i>
			
			关于
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/contact" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-comments"></i>
			
			留言板
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/friends" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-address-book"></i>
			
			友情链接
		</a>
          
        </li>
        
        
    </ul>
</div>

        </div>

        
    </nav>

</header>

    
<script src="/libs/cryptojs/crypto-js.min.js"></script>
<script>
    (function() {
        let pwd = '';
        if (pwd && pwd.length > 0) {
            if (pwd !== CryptoJS.SHA256(prompt('请输入访问本文章的密码')).toString(CryptoJS.enc.Hex)) {
                alert('密码错误，将返回主页！');
                location.href = '/';
            }
        }
    })();
</script>




<div class="bg-cover pd-header post-cover" style="background-image: url('/medias/featureimages/5.jpg')">
    <div class="container" style="right: 0px;left: 0px;">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <h1 class="description center-align post-title">部署hexo到github</h1>
                </div>
            </div>
        </div>
    </div>
</div>




<main class="post-container content">

    
    <link rel="stylesheet" href="/libs/tocbot/tocbot.css">
<style>
    #articleContent h1::before,
    #articleContent h2::before,
    #articleContent h3::before,
    #articleContent h4::before,
    #articleContent h5::before,
    #articleContent h6::before {
        display: block;
        content: " ";
        height: 100px;
        margin-top: -100px;
        visibility: hidden;
    }

    #articleContent :focus {
        outline: none;
    }

    .toc-fixed {
        position: fixed;
        top: 64px;
    }

    .toc-widget {
        width: 345px;
        padding-left: 20px;
    }

    .toc-widget .toc-title {
        margin: 35px 0 15px 0;
        padding-left: 17px;
        font-size: 1.5rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    .toc-widget ol {
        padding: 0;
        list-style: none;
    }

    #toc-content {
        height: calc(100vh - 250px);
        overflow: auto;
    }

    #toc-content ol {
        padding-left: 10px;
    }

    #toc-content ol li {
        padding-left: 10px;
    }

    #toc-content .toc-link:hover {
        color: #42b983;
        font-weight: 700;
        text-decoration: underline;
    }

    #toc-content .toc-link::before {
        background-color: transparent;
        max-height: 25px;
    }

    #toc-content .is-active-link {
        color: #42b983;
    }

    #toc-content .is-active-link::before {
        background-color: #42b983;
    }

    #floating-toc-btn {
        position: fixed;
        right: 15px;
        bottom: 76px;
        padding-top: 15px;
        margin-bottom: 0;
        z-index: 998;
    }

    #floating-toc-btn .btn-floating {
        width: 48px;
        height: 48px;
    }

    #floating-toc-btn .btn-floating i {
        line-height: 48px;
        font-size: 1.4rem;
    }
</style>
<div class="row">
    <div id="main-content" class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                    <div class="article-tag">
                        
                            <a href="/tags/hexo/">
                                <span class="chip bg-color">hexo</span>
                            </a>
                        
                            <a href="/tags/github/">
                                <span class="chip bg-color">github</span>
                            </a>
                        
                            <a href="/tags/%E7%BD%91%E7%AB%99%E9%83%A8%E7%BD%B2/">
                                <span class="chip bg-color">网站部署</span>
                            </a>
                        
                    </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                    <div class="post-cate">
                        <i class="fas fa-bookmark fa-fw icon-category"></i>
                        
                            <a href="/categories/%E7%BD%91%E7%AB%99%E5%BB%BA%E8%AE%BE/" class="post-category">
                                网站建设
                            </a>
                        
                    </div>
                    
                </div>
            </div>

            <div class="post-info">
                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-minus fa-fw"></i>发布日期:&nbsp;&nbsp;
                    2020-02-04
                </div>
                

                

                
                <div class="info-break-policy">
                    <i class="far fa-file-word fa-fw"></i>文章字数:&nbsp;&nbsp;
                    1.5k
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-clock fa-fw"></i>阅读时长:&nbsp;&nbsp;
                    6 分
                </div>
                

                
                    <div id="busuanzi_container_page_pv" class="info-break-policy">
                        <i class="far fa-eye fa-fw"></i>阅读次数:&nbsp;&nbsp;
                        <span id="busuanzi_value_page_pv"></span>
                    </div>
				
            </div>

        </div>
        <hr class="clearfix">
        <div class="card-content article-card-content">
            <div id="articleContent">
                <h1 id="部署hexo到github上"><a href="#部署hexo到github上" class="headerlink" title="部署hexo到github上"></a>部署<code>hexo</code>到<code>github</code>上</h1><h2 id="1-申请github账号"><a href="#1-申请github账号" class="headerlink" title="1. 申请github账号"></a>1. 申请<code>github</code>账号</h2><ol>
<li>进入<code>https://github.com/</code>申请，我这里申请的用户名是<code>lmwings</code></li>
<li>建立个人仓库，仓库名为<code>lmwings.github.io</code>，这个是规则是固定的，一个账号只有一个<code>github page</code>页面. 即<code>&lt;用户名&gt;.github.io</code></li>
</ol>
<h2 id="2-上传"><a href="#2-上传" class="headerlink" title="2. 上传"></a>2. 上传</h2><p>把本地验证好的<code>hexo</code>个人网站，上传到<code>lmwings.github.io</code>仓库中</p>
<ol>
<li><p><code>windows</code>安装好<code>git</code></p>
</li>
<li><p>打开<code>Git Bash</code>，输入<code>github</code>相关账号</p>
<pre class=" language-shell"><code class="language-shell">git config --global user.name "你的GitHub用户名"
git config --global user.email "你的GitHub注册邮箱"</code></pre>
</li>
<li><p>生成<code>ssh</code>密钥文件</p>
<pre class=" language-shell"><code class="language-shell">ssh-keygen -t rsa -C "你的GitHub注册邮箱"</code></pre>
<p>直接一直回车即可，然后找到生成的<code>.ssh</code>文件夹中的<code>id_rsa.pub</code>文件，把内容全部复制</p>
<p><code>https://github.com/settings/keys</code>页面中新建<code>new SSH Key</code>，标题随便起。</p>
</li>
<li><p>验证密钥是否成功</p>
<p>在<code>git bash</code>中输入<code>ssh git@github.com</code></p>
<pre class=" language-shell"><code class="language-shell">Administrator@JIKXYRXHZ8CSKUY MINGW64 /e/work/hexo_blog
$ ssh git@github.com
PTY allocation request failed on channel 0
Hi lmwings! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.

Administrator@JIKXYRXHZ8CSKUY MINGW64 /e/work/hexo_blog
</code></pre>
</li>
<li><p><code>hexo</code>一些命令</p>
<pre class=" language-python"><code class="language-python"><span class="token comment" spellcheck="true"># 新建文章</span>
hexo n 新建文章<span class="token number">1</span>
<span class="token comment" spellcheck="true"># 新建页面</span>
hexo page categorys
<span class="token comment" spellcheck="true"># 生成</span>
hexo g
<span class="token comment" spellcheck="true"># 启动服务预览</span>
hexo s
<span class="token comment" spellcheck="true"># 部署</span>
hexo d
<span class="token comment" spellcheck="true"># 清除缓存</span>
hexo clean</code></pre>
</li>
<li><p>修改本地<code>hexo</code>代码根目录下的<code>_config.ymal</code>配置</p>
<pre class=" language-yaml"><code class="language-yaml"><span class="token key atrule">deploy</span><span class="token punctuation">:</span>
  <span class="token key atrule">type</span><span class="token punctuation">:</span> git
  <span class="token key atrule">repo</span><span class="token punctuation">:</span> https<span class="token punctuation">:</span>//github.com/lmwings/lmwings.github.io.git
  <span class="token key atrule">branch</span><span class="token punctuation">:</span> master</code></pre>
</li>
<li><p>按照部署插件</p>
<pre class=" language-shell"><code class="language-shell">npm install hexo-deployer-git --save</code></pre>
</li>
<li><p>推送部署</p>
<pre class=" language-shell"><code class="language-shell">hexo clean
hexo g
hexo d</code></pre>
</li>
<li><p>访问验证</p>
<p><code>lmwings.github.io</code></p>
</li>
</ol>
<h2 id="部署到其他平台"><a href="#部署到其他平台" class="headerlink" title="部署到其他平台"></a>部署到其他平台</h2><p><strong>部署到<code>coding</code></strong></p>
<p>由于<code>github</code>是国外的，在国内访问较慢，所以我同时部署到<code>gitee</code>和<code>coding</code>上面。</p>
<p>步骤大部分和<code>github</code>上面部署是一样的，下面做简单的记录</p>
<ol>
<li><p>部署到<code>coding</code></p>
<p><strong>首先</strong>， <code>https://coding.net/</code>申请账号</p>
<p>这里会要求先创建团体，再创建用户，可以按自己随便起，里面可以修改。</p>
<p><strong>然后</strong>，创建一个和自己的用户名一样的项目仓库， <strong>注意</strong>： 启用README.md文件初始化项目 ，最好打钩，否则可能找不到<code>master分支</code></p>
<p><strong>再</strong>，配置<code>ssh</code>公钥，这个步骤就是<code>github部署</code>时候的第3步，电脑中生成的<code>id_rsa.pub</code>文件即为公钥，为了能在多个代码托管平台工作，需要生成一个新的。这里输入的<code>coding</code>就是生成是公钥文件名</p>
<pre class=" language-shell"><code class="language-shell"># Windows默认生成的路径
$ cd /c/Users/Administrator/.ssh

# 生成公钥文件，后面邮箱是我注册的邮箱地址，输入文件名为 coding即会生成 coding.pud文件
$ ssh-keygen -t rsa -b 4096 -C 1321559220@qq.com
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa): coding</code></pre>
<p>然后把<code>coding.pub</code>的内容填写到<code>https://lmwings.coding.net/user/account/setting/keys</code></p>
<p>测试一下是否设置正常</p>
<pre class=" language-shell"><code class="language-shell">ssh -T git@e.coding.net</code></pre>
<p><strong>发现测试失败</strong>， 提示<code>git@git.coding.net: Permission denied (publickey).</code></p>
<p>这个要么就是<code>git</code>账号错误，要么就是<code>ssh -T</code>命令输入错误了.</p>
</li>
<li><p>配置<code>hexo</code>根目录下的<code>_config.yml</code></p>
<pre class=" language-yaml"><code class="language-yaml"><span class="token key atrule">deploy</span><span class="token punctuation">:</span>
  <span class="token key atrule">type</span><span class="token punctuation">:</span> git
  <span class="token key atrule">repo</span><span class="token punctuation">:</span> 
    <span class="token key atrule">github</span><span class="token punctuation">:</span> https<span class="token punctuation">:</span>//github.com/lmwings/lmwings.github.io.git<span class="token punctuation">,</span>master
    <span class="token key atrule">coding</span><span class="token punctuation">:</span> https<span class="token punctuation">:</span>//e.coding.net/lmwings/lmwings.git<span class="token punctuation">,</span>master</code></pre>
</li>
<li><p>推送部署</p>
<pre class=" language-shell"><code class="language-shell">hexo clean
hexo g
hexo d</code></pre>
</li>
<li><p>需要在<code>condig.net</code>上</p>
<p>需要实名认证后才允许使用<code>pages</code>功能，触发机制可以选择手动部署和自动部署</p>
<p><code>构建与部署--静态网站--立即部署</code></p>
</li>
<li><p>访问上面的地址</p>
<pre class=" language-shell"><code class="language-shell">https://722tv0.coding-pages.com/</code></pre>
</li>
</ol>
<p><strong>部署到<code>gitee</code></strong></p>
<ol>
<li><p>申请<code>gitee</code>账号</p>
<p><code>https://gitee.com/</code></p>
</li>
<li><p>创建项目</p>
<p>项目名和用户名，还有范围地址中的最好是相同的，这个可以保证可以通过<code>&lt;用户名&gt;.gitee.io</code>进行访问，否则会多一级目录，我这里就填写<code>lmwings</code>,然后创建</p>
</li>
<li><p>到项目中，选择<code>服务--Gitee Pages</code>，部署分支选择<code>master</code>即可，部署目录可以不用填，启用以后会有网站地址，我的地址为<code>https://lmwings.gitee.io/blog</code></p>
</li>
<li><p>生成<code>ssh-key</code>公钥，这个和上面方法一样</p>
<pre class=" language-shell"><code class="language-shell"># Windows默认生成的路径
$ cd /c/Users/Administrator/.ssh

# 生成公钥文件，后面邮箱是我注册的邮箱地址，输入文件名为 coding即会生成 coding.pud文件
$ ssh-keygen -t rsa -b 4096 -C 1321559220@qq.com
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa): rsa_gitee</code></pre>
<p>然后把<code>rsa_gitee.pub</code>填写到</p>
<p><code>https://gitee.com/profile/sshkeys</code> （我自己使用一般直接设置账号的，不设置仓库的）</p>
<p>测试一下是否正常</p>
<pre class=" language-shell"><code class="language-shell">ssh -T git@gitee.com</code></pre>
</li>
<li><p>部署更新后，到<code>gitee Pages</code>手动更新一下</p>
<p><strong>付费版本<code>gitee Pages Pro</code>，可以支持自定义域名，支持推送后自动部署，普通不行</strong></p>
</li>
<li><p>访问一下</p>
<p><code>https://lmwings.gitee.io/</code></p>
</li>
</ol>
<p><strong>部署到<code>gitlab</code></strong></p>
<ol>
<li><p>申请<code>gitlab</code>账号</p>
<p><code>https://gitlab.com/</code></p>
</li>
<li><p>创建项目， 名称规则同<code>github</code>， 即 <code>&lt;用户名&gt;.gitlab.io</code></p>
</li>
<li><p>生成<code>ssh-key</code>公钥，方法一样</p>
<pre class=" language-shell"><code class="language-shell"># Windows默认生成的路径
$ cd /c/Users/Administrator/.ssh

$ ssh-keygen -t rsa -C 1321559220@qq.com
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa): rsa_gitlab
</code></pre>
<p>然后把<code>rsa_gitlab.pub</code>填写到</p>
<p><code>https://gitlab.com/profile/keys</code></p>
<p>测试一下是否正常</p>
<pre class=" language-shell"><code class="language-shell">ssh -T git@gitlab.com</code></pre>
</li>
<li><p>这个和其他的不一样，</p>
<p>没有显示的<code>gitlab pages</code>设置界面，主要是<code>gitlab</code>有<code>gitlab ci</code>, 如果项目中存在<code>.gitlab-ci.yml</code>的文件，就会自动触发<code>gitlab runner</code>来执行这个脚本，所以和其他发布不一样，这个仓库中需要上传的是<code>本地的hexo源码</code></p>
</li>
<li><p><code>.gitlab-ci.yml</code>脚本编写可以参考</p>
<p>（暂时还未来得及验证。）</p>
<p><code>https://hexo.io/zh-cn/docs/gitlab-pages</code> </p>
<p><code>https://www.cnblogs.com/zhangnan35/p/10709252.html</code></p>
</li>
<li></li>
</ol>
<h2 id="一键部署"><a href="#一键部署" class="headerlink" title="一键部署"></a>一键部署</h2><p>可以利用<code>Traivs CI</code>等持续集成平台进行部署</p>
<p>参考<code>https://hexo.io/zh-cn/docs/one-command-deployment</code></p>
<script>
        document.querySelectorAll('.github-emoji')
          .forEach(el => {
            if (!el.dataset.src) { return; }
            const img = document.createElement('img');
            img.style = 'display:none !important;';
            img.src = el.dataset.src;
            img.addEventListener('error', () => {
              img.remove();
              el.style.color = 'inherit';
              el.style.backgroundImage = 'none';
              el.style.background = 'none';
            });
            img.addEventListener('load', () => {
              img.remove();
            });
            document.body.appendChild(img);
          });
      </script>
            </div>
            <hr/>

            

    <div class="reprint" id="reprint-statement">
        
            <div class="reprint__author">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-user">
                        文章作者:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="http://www.lmwings.top" rel="external nofollow noreferrer">Wang Kang</a>
                </span>
            </div>
            <div class="reprint__type">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-link">
                        文章链接:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="http://www.lmwings.top/bu-shu-hexo-dao-github.html">http://www.lmwings.top/bu-shu-hexo-dao-github.html</a>
                </span>
            </div>
            <div class="reprint__notice">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-copyright">
                        版权声明:
                    </i>
                </span>
                <span class="reprint-info">
                    本博客所有文章除特別声明外，均采用
                    <a href="https://creativecommons.org/licenses/by/4.0/deed.zh" rel="external nofollow noreferrer" target="_blank">CC BY 4.0</a>
                    许可协议。转载请注明来源
                    <a href="http://www.lmwings.top" target="_blank">Wang Kang</a>
                    !
                </span>
            </div>
        
    </div>

    <script async defer>
      document.addEventListener("copy", function (e) {
        let toastHTML = '<span>复制成功，请遵循本文的转载规则</span><button class="btn-flat toast-action" onclick="navToReprintStatement()" style="font-size: smaller">查看</a>';
        M.toast({html: toastHTML})
      });

      function navToReprintStatement() {
        $("html, body").animate({scrollTop: $("#reprint-statement").offset().top - 80}, 800);
      }
    </script>



            <div class="tag_share" style="display: block;">
                <div class="post-meta__tag-list" style="display: inline-block;">
                    
                        <div class="article-tag">
                            
                                <a href="/tags/hexo/">
                                    <span class="chip bg-color">hexo</span>
                                </a>
                            
                                <a href="/tags/github/">
                                    <span class="chip bg-color">github</span>
                                </a>
                            
                                <a href="/tags/%E7%BD%91%E7%AB%99%E9%83%A8%E7%BD%B2/">
                                    <span class="chip bg-color">网站部署</span>
                                </a>
                            
                        </div>
                    
                </div>
                <div class="post_share" style="zoom: 80%; width: fit-content; display: inline-block; float: right; margin: -0.15rem 0;">
                    <link rel="stylesheet" type="text/css" href="/libs/share/css/share.min.css">

<div id="article-share">
    
    
    <div class="social-share" data-sites="twitter,facebook,google,qq,qzone,wechat,weibo,douban,linkedin" data-wechat-qrcode-helper="<p>微信扫一扫即可分享！</p>"></div>
    <script src="/libs/share/js/social-share.min.js"></script>
    

    

</div>

                </div>
            </div>
            
                <style>
    #reward {
        margin: 40px 0;
        text-align: center;
    }

    #reward .reward-link {
        font-size: 1.4rem;
        line-height: 38px;
    }

    #reward .btn-floating:hover {
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    #rewardModal {
        width: 320px;
        height: 350px;
    }

    #rewardModal .reward-title {
        margin: 15px auto;
        padding-bottom: 5px;
    }

    #rewardModal .modal-content {
        padding: 10px;
    }

    #rewardModal .close {
        position: absolute;
        right: 15px;
        top: 15px;
        color: rgba(0, 0, 0, 0.5);
        font-size: 1.3rem;
        line-height: 20px;
        cursor: pointer;
    }

    #rewardModal .close:hover {
        color: #ef5350;
        transform: scale(1.3);
        -moz-transform:scale(1.3);
        -webkit-transform:scale(1.3);
        -o-transform:scale(1.3);
    }

    #rewardModal .reward-tabs {
        margin: 0 auto;
        width: 210px;
    }

    .reward-tabs .tabs {
        height: 38px;
        margin: 10px auto;
        padding-left: 0;
    }

    .reward-content ul {
        padding-left: 0 !important;
    }

    .reward-tabs .tabs .tab {
        height: 38px;
        line-height: 38px;
    }

    .reward-tabs .tab a {
        color: #fff;
        background-color: #ccc;
    }

    .reward-tabs .tab a:hover {
        background-color: #ccc;
        color: #fff;
    }

    .reward-tabs .wechat-tab .active {
        color: #fff !important;
        background-color: #22AB38 !important;
    }

    .reward-tabs .alipay-tab .active {
        color: #fff !important;
        background-color: #019FE8 !important;
    }

    .reward-tabs .reward-img {
        width: 210px;
        height: 210px;
    }
</style>

<div id="reward">
    <a href="#rewardModal" class="reward-link modal-trigger btn-floating btn-medium waves-effect waves-light red">赏</a>

    <!-- Modal Structure -->
    <div id="rewardModal" class="modal">
        <div class="modal-content">
            <a class="close modal-close"><i class="fas fa-times"></i></a>
            <h4 class="reward-title">你的赏识是我前进的动力</h4>
            <div class="reward-content">
                <div class="reward-tabs">
                    <ul class="tabs row">
                        <li class="tab col s6 alipay-tab waves-effect waves-light"><a href="#alipay">支付宝</a></li>
                        <li class="tab col s6 wechat-tab waves-effect waves-light"><a href="#wechat">微 信</a></li>
                    </ul>
                    <div id="alipay">
                        <img src="/medias/reward/alipay.jpg" class="reward-img" alt="支付宝打赏二维码">
                    </div>
                    <div id="wechat">
                        <img src="/medias/reward/wechat.png" class="reward-img" alt="微信打赏二维码">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        $('.tabs').tabs();
    });
</script>
            
        </div>
    </div>

    
        <link rel="stylesheet" href="/libs/gitalk/gitalk.css">
<link rel="stylesheet" href="/css/my-gitalk.css">

<div class="card gitalk-card" data-aos="fade-up">
    <div class="comment_headling" style="font-size: 20px; font-weight: 700; position: relative; left: 20px; top: 15px; padding-bottom: 5px;">
        <i class="fas fa-comments fa-fw" aria-hidden="true"></i>
        <span>评论</span>
    </div>
    <div id="gitalk-container" class="card-content"></div>
</div>

<script src="/libs/gitalk/gitalk.min.js"></script>
<script>
    let gitalk = new Gitalk({
        clientID: '0123e9f950656f3c89b6',
        clientSecret: '7ed5378272d9a12cf3be09c4cde0d24015b200b1',
        repo: 'lmwings.github.io',
        owner: 'lmwings',
        admin: "lmwings",
        id: '2020-02-04T17-20-26',
        distractionFreeMode: false  // Facebook-like distraction free mode
    });

    gitalk.render('gitalk-container');
</script>
    

    

    

    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="fas fa-chevron-left"></i>&nbsp;上一篇</div>
            <div class="card">
                <a href="/tong-yi-dian-nao-duo-ge-ssh-key-guan-li.html">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/15.jpg" class="responsive-img" alt="同一电脑多个ssh-key管理">
                        
                        <span class="card-title">同一电脑多个ssh-key管理</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            Windows上多git账号/多ssh-key管理1. 说明主要是用于多个代码托管平台，常见的有github、coding、gitee等
在设置ssh公钥时候，一般一个平台生成一封文件夹有平台标识的公钥文件, 一般默认路径为.ssh/*.p
                        
                    </div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="far fa-clock fa-fw icon-date"></i>2020-02-05
                        </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/%E6%8A%80%E6%9C%AF%E6%96%87%E7%AB%A0/" class="post-category">
                                    技术文章
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/git/">
                        <span class="chip bg-color">git</span>
                    </a>
                    
                    <a href="/tags/ssh/">
                        <span class="chip bg-color">ssh</span>
                    </a>
                    
                    <a href="/tags/ssh-key/">
                        <span class="chip bg-color">ssh-key</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                下一篇&nbsp;<i class="fas fa-chevron-right"></i>
            </div>
            <div class="card">
                <a href="/da-jian-ge-ren-hexo-wang-zhan.html">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/19.jpg" class="responsive-img" alt="搭建个人的Hexo静态网站">
                        
                        <span class="card-title">搭建个人的Hexo静态网站</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            搭建个人Hexo网站1. 环境安装需要依赖node.js环境，下载node.js安装包，安装好以后会自动安装js和npm环境.
安装nodejs
下载node.js安装包，选择对应系统和版本，如果是win7，需要用nodejs 12的版本；
                        
                    </div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="far fa-clock fa-fw icon-date"></i>2020-02-04
                            </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/%E7%BD%91%E7%AB%99%E5%BB%BA%E8%AE%BE/" class="post-category">
                                    网站建设
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/hexo/">
                        <span class="chip bg-color">hexo</span>
                    </a>
                    
                    <a href="/tags/%E7%BD%91%E7%AB%99/">
                        <span class="chip bg-color">网站</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
    </div>
</article>

</div>


<script>
    $('#articleContent').on('copy', function (e) {
        // IE8 or earlier browser is 'undefined'
        if (typeof window.getSelection === 'undefined') return;

        var selection = window.getSelection();
        // if the selection is short let's not annoy our users.
        if (('' + selection).length < Number.parseInt('120')) {
            return;
        }

        // create a div outside of the visible area and fill it with the selected text.
        var bodyElement = document.getElementsByTagName('body')[0];
        var newdiv = document.createElement('div');
        newdiv.style.position = 'absolute';
        newdiv.style.left = '-99999px';
        bodyElement.appendChild(newdiv);
        newdiv.appendChild(selection.getRangeAt(0).cloneContents());

        // we need a <pre> tag workaround.
        // otherwise the text inside "pre" loses all the line breaks!
        if (selection.getRangeAt(0).commonAncestorContainer.nodeName === 'PRE') {
            newdiv.innerHTML = "<pre>" + newdiv.innerHTML + "</pre>";
        }

        var url = document.location.href;
        newdiv.innerHTML += '<br />'
            + '来源: 嘟嘟嘴的窝<br />'
            + '文章作者: 柠檬之翼<br />'
            + '文章链接: <a href="' + url + '">' + url + '</a><br />'
            + '本文章著作权归作者所有，任何形式的转载都请注明出处。';

        selection.selectAllChildren(newdiv);
        window.setTimeout(function () {bodyElement.removeChild(newdiv);}, 200);
    });
</script>


<!-- 代码块功能依赖 -->
<script type="text/javascript" src="/libs/codeBlock/codeBlockFuction.js"></script>

<!-- 代码语言 -->

<script type="text/javascript" src="/libs/codeBlock/codeLang.js"></script>


<!-- 代码块复制 -->

<script type="text/javascript" src="/libs/codeBlock/codeCopy.js"></script>


<!-- 代码块收缩 -->

<script type="text/javascript" src="/libs/codeBlock/codeShrink.js"></script>


<!-- 代码块折行 -->

<style type="text/css">
code[class*="language-"], pre[class*="language-"] { white-space: pre !important; }
</style>


    </div>
    <div id="toc-aside" class="expanded col l3 hide-on-med-and-down">
        <div class="toc-widget">
            <div class="toc-title"><i class="far fa-list-alt"></i>&nbsp;&nbsp;目录</div>
            <div id="toc-content"></div>
        </div>
    </div>
</div>

<!-- TOC 悬浮按钮. -->

<div id="floating-toc-btn" class="hide-on-med-and-down">
    <a class="btn-floating btn-large bg-color">
        <i class="fas fa-list-ul"></i>
    </a>
</div>


<script src="/libs/tocbot/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingsOffset: -($(window).height() * 0.4 - 45),
            collapseDepth: Number('0'),
            headingSelector: 'h2, h3, h4'
        });

        // modify the toc link href to support Chinese.
        let i = 0;
        let tocHeading = 'toc-heading-';
        $('#toc-content a').each(function () {
            $(this).attr('href', '#' + tocHeading + (++i));
        });

        // modify the heading title id to support Chinese.
        i = 0;
        $('#articleContent').children('h2, h3, h4').each(function () {
            $(this).attr('id', tocHeading + (++i));
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });

        
        /* 修复文章卡片 div 的宽度. */
        let fixPostCardWidth = function (srcId, targetId) {
            let srcDiv = $('#' + srcId);
            if (srcDiv.length === 0) {
                return;
            }

            let w = srcDiv.width();
            if (w >= 450) {
                w = w + 21;
            } else if (w >= 350 && w < 450) {
                w = w + 18;
            } else if (w >= 300 && w < 350) {
                w = w + 16;
            } else {
                w = w + 14;
            }
            $('#' + targetId).width(w);
        };

        // 切换TOC目录展开收缩的相关操作.
        const expandedClass = 'expanded';
        let $tocAside = $('#toc-aside');
        let $mainContent = $('#main-content');
        $('#floating-toc-btn .btn-floating').click(function () {
            if ($tocAside.hasClass(expandedClass)) {
                $tocAside.removeClass(expandedClass).hide();
                $mainContent.removeClass('l9');
            } else {
                $tocAside.addClass(expandedClass).show();
                $mainContent.addClass('l9');
            }
            fixPostCardWidth('artDetail', 'prenext-posts');
        });
        
    });
</script>

    

</main>



    <footer class="page-footer bg-color">
    <div class="container row center-align" style="margin-bottom: 0px !important;">
        <div class="col s12 m8 l8 copy-right">
            Copyright&nbsp;&copy;
            <span id="year">2019</span>
            <a href="http://www.lmwings.top" target="_blank">柠檬之翼</a>
            |&nbsp;Powered by&nbsp;<a href="https://hexo.io/" target="_blank">Hexo</a>
            |&nbsp;Theme&nbsp;<a href="https://github.com/blinkfox/hexo-theme-matery" target="_blank">Matery</a>
            <br>
            
            &nbsp;<i class="fas fa-chart-area"></i>&nbsp;站点总字数:&nbsp;<span
                class="white-color">31.2k</span>&nbsp;字
            
            
            
            
            
            
            <span id="busuanzi_container_site_pv">
                |&nbsp;<i class="far fa-eye"></i>&nbsp;总访问量:&nbsp;<span id="busuanzi_value_site_pv"
                    class="white-color"></span>&nbsp;次
            </span>
            
            
            <span id="busuanzi_container_site_uv">
                |&nbsp;<i class="fas fa-users"></i>&nbsp;总访问人数:&nbsp;<span id="busuanzi_value_site_uv"
                    class="white-color"></span>&nbsp;人
            </span>
            
            <br>
            
            <br>
            
        </div>
        <div class="col s12 m4 l4 social-link social-statis">
    <a href="https://github.com/lmwings" class="tooltipped" target="_blank" data-tooltip="访问我的GitHub" data-position="top" data-delay="50">
        <i class="fab fa-github"></i>
    </a>



    <a href="mailto:1321559220@qq.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fas fa-envelope-open"></i>
    </a>







    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=1321559220" class="tooltipped" target="_blank" data-tooltip="QQ联系我: 1321559220" data-position="top" data-delay="50">
        <i class="fab fa-qq"></i>
    </a>







    <a href="/atom.xml" class="tooltipped" target="_blank" data-tooltip="RSS 订阅" data-position="top" data-delay="50">
        <i class="fas fa-rss"></i>
    </a>

</div>
    </div>
</footer>

<div class="progress-bar"></div>


    <!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fas fa-search"></i>&nbsp;&nbsp;搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字"
                   class="search-input">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script src="/js/search.js"></script>
<script type="text/javascript">
$(function () {
    searchFunc("/" + "search.xml", 'searchInput', 'searchResult');
});
</script>
    <!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fas fa-arrow-up"></i>
    </a>
</div>


    <script src="/libs/materialize/materialize.min.js"></script>
    <script src="/libs/masonry/masonry.pkgd.min.js"></script>
    <script src="/libs/aos/aos.js"></script>
    <script src="/libs/scrollprogress/scrollProgress.min.js"></script>
    <script src="/libs/lightGallery/js/lightgallery-all.min.js"></script>
    <script src="/js/matery.js"></script>

    <!-- Global site tag (gtag.js) - Google Analytics -->


    <!-- Baidu Analytics -->

<script>
    var _hmt = _hmt || [];
    (function () {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?6fdfb99af350f72ffa28464cc4abaa04";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>

    <!-- Baidu Push -->

<script>
    (function () {
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        } else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

    
    <script src="/libs/others/clicklove.js" async="async"></script>
    
    
    <script async src="/libs/others/busuanzi.pure.mini.js"></script>
    

    

    

    

    

    
    
    
    <script src="/libs/instantpage/instantpage.js" type="module"></script>
    

</body>

</html>
